<div id="files">
<? echo $adminMenu->manage(); ?>
<h2><?php __('FILES_ADMIN_TITLE');?> (<? echo $html->link(__('FILE_NEW',true), array('action'=>'add')); ?>)</h2>
<? echo $form -> create(array('action'=>'delete_files')); ?>
<table cellpadding="3" cellspacing="1" width="100%">
<tr>
	<td width="10%"></td>
	<td></td>
	<td width="10%"></td>
	<td width="10%"></td>
	<td width="10%"></td>
	<td width="10%"></td>
</tr>
<tr class="table_head">
	<td colspan="2" class="first-top">
		<? echo $pagination -> create(null,'files'); ?>
	</td>
	<td colspan="4" class="last-top">
		<? __('SORT_BY'); ?>: <?php echo $paginator->sort(__('NAME',true),'file');?> <? echo $paginator->sort(__('SIZE',true),'size'); ?> <?php echo $paginator->sort(__('DOWNLOADED',true),'downloaded');?>
	</td>
</tr>
<tr>
	<th><? __('ACTION'); ?></th>
	<th><? __('NAME'); ?></th>
	<th><? __('SIZE'); ?></th>
	<th><? __('TYPE'); ?></th>
	<th><? __('DOWNLOADED'); ?></th>
	<th><? __('DELETE'); ?> <input type="checkbox" onclick="checkAll(this,'ArticleDeleteArticlesForm')"/></th>
</tr>
<?php
$i = 0;
foreach ($downloads as $file):
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}
?>
	<tr<?php echo $class;?>>
		<td>
			<?php echo $html->link($html->image('edit.png',array('alt'=>__('EDIT', true))),array('action'=>'edit', $file['Download']['id']),array('title'=>__('EDIT',true)),null,false); ?> 
			<? echo $html->link($html->image('eye.png',array('alt'=>__("PREVIEW",true))),"/downloads/view/".$file['Download']['file'],array('title'=>__('PREVIEW',true),"target"=>"new"),null,false); ?>
			<?php echo $html->link($html->image('bin.png',array('alt'=>__('DELETE', true))), array('action'=>'delete', $file['Download']['id']),array('title'=>__('DELETE',true)), __('DELETE_ITEM', true).' #' . $file['Download']['file'],false); ?>
		</td>
		<td>
			<?php echo $html->link($file['Download']['file'],array('action'=>'edit',$file['Download']['id'])); ?>
		</td>
		<td>
			<? echo $number->toReadableSize($file['Download']['size']); ?>
		</td>
		<td>
			<? echo $file['Download']['type']; ?>
		</td>
		<td>
			<? echo $file['Download']['downloaded']; ?>
		</td>
		<td  align="center">
			<input type="checkbox" name="data[FilessDelete][]" value="<? echo $file['Download']['id']; ?>"/>
		</td>
	</tr>
<?php endforeach; ?>
<tr class="table_head">
	<td colspan="2" class="first-bottom">
		<? echo $pagination -> create(null,'files'); ?>
	</td>
	<td colspan="4" class="last-bottom">
		<? __('SORT_BY'); ?>: <?php echo $paginator->sort(__('NAME',true),'file');?> <? echo $paginator->sort(__('SIZE',true),'size'); ?> <?php echo $paginator->sort(__('DOWNLOADED',true),'downloaded');?>
	</td>
</tr>
</table>
</form>
</div>